<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
	  <title>员工修改</title>
	</head>
	<body>
		<table border="0" width="600px">
			<tr>
				<td align="center" style="font-size: 24px; color: #666">
					员工添加
				</td>
			</tr>
			<tr>
				<td align="right">
					<a href="javascript:document.getElementById('saveForm').submit();">保存</a> &nbsp;&nbsp;
					<a href="javascript:history.go(-1)">退回</a>
				</td>
			</tr>
		</table>
		<br />

		<form id="saveForm" action="${pageContext.request.contextPath}/employee/update" method="post">
		<input type="hidden" name="" value="${employee.eid}" />
			<table border='0' cellpadding="0" cellspacing="10">
				<tr>
					<td>
						姓名：
					</td>
					<td>
						<input type="text" name="ename" value="${employee.ename}" />
					</td>
					<td>
						性别：
					</td>
					<td>
						<c:choose>  
					        <c:when test="${'男' eq employee.sex}">  
					        <input type="radio" name="sex" value="男" checked="checked">男    
					        <input type="radio" name="sex" value="女">女  
					        </c:when>  
					        <c:when test="${'女' eq employee.sex}">  
					        <input type="radio" name="sex" value="男" >男    
					        <input type="radio" name="sex" value="女" checked="checked">女  
					        </c:when>  
				        </c:choose> 
					</td>
				</tr>
				<tr>
					<td>
						用户名：
					</td>
					<td>
						<input type="text" name="username" value="${employee.username}" />
					</td>
					<td>
						密码：
					</td>
					<td>
						<input type="text" name="password" value="${employee.password}"/>
					</td>
				</tr>
				<tr>
					<td>
						出生日期：
					</td>
					<td>
						<input type="text" name="birthday" value="<fmt:formatDate value="${employee.birthday}" pattern="yyyy-MM-dd" />"/>
					</td>
					<td>
						入职时间：
					</td>
					<td>
						<input type="text" name="joinDate" value="<fmt:formatDate value="${employee.joinDate}" pattern="yyyy-MM-dd" />"/>
					</td>
				</tr>

				<tr>
					<td>
						所属部门：
					</td>
					<td>
						<select name="dno">
						  <option value="">---请选择---</option>						
						  <c:forEach items="${departments}" var="d">
						    <option value="${d.did}" <c:if test="${d.did == employee.dno}">selected="selected"</c:if> >${d.dname}</option>
						  </c:forEach>
						</select>
					</td>
					<td>
						编号：
					</td>
					<td>
						<input type="text" name="eno" value="${employee.eno}"/>
					</td>
				</tr>
			</table>
		</form>

	</body>
</html>